<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //倒计时函数：根据输入的时间（符合标准格式的时间字符串），给出当前时间距离输入时间的倒计时内容；
        let date = new Date();
        let time = date.getTime();
        console.log(time);
        let dates = new Date('2022-10-06');
        let times = dates.getTime();
        console.log(times);
        function getTime(min){
            let d = parseInt(min/60/60/24);
            let h = parseInt(min/60/60%24);
            let m = parseInt(min/60%60);
            let s = parseInt(min%60);
            return "剩余的时间"+d+"天"+h+"时"+m+"分"+s+"秒";
        }
        let min = (times-time)/1000;
        console.log(getTime(min));
    </script>
</body>
</html>